Applying palette-based color composition to an electronic image

ABSTRACT

Certain embodiments involve applying a palette-based color harmony and palette-based image recoloration to an electronic image. For instance, an electronic image processing application accesses a color palette that includes colors at a different positions in a color space. The electronic image processing application selects a harmonic template that, when applied to the color palette, minimizes an aggregate of hue distances between the positions in the color space and axes of the harmonic template. The electronic image processing application modifies the color palette based on the selected harmonic template.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/197,633, filed on Nov. 21, 2018, allowed, the contents of which areincorporated in its entirety herein by reference.

TECHNICAL FIELD

This disclosure relates generally to creating or manipulating ofartificial images or other graphic objects. Specifically, the presentdisclosure involves applying palette-based color composition to anelectronic image.

BACKGROUND

Color composition of electronic images involves modifying the componentcolors in an image to enhance the visual appeal of the image. Forinstance, software applications can analyze the colors and contents ofan electronic image and automatically modify (or suggest modificationsto) the colors within the content of a given image.

A common method of analysis for the colors of an electronic image isextracting a subset of colors from the electronic image to a colorpalette. The subset of colors has relationships that can be representedin a color space by angular or linear distances. For instance, colorharmony is a predefined set of relationships between a subset of colorsthat are established based on the aesthetic quality of the image basedon the way the human eye perceives color and contrast. In a basicexample, ideal complementary colors are two colors that are directlyopposite in the color space, such as red and green, or blue and yellow.Certain color relationships that improve aesthetic quality have beenestablished to standardize the predefined color harmonies. The specificrelationships have been standardized into relationship templates (i.e.,complementary colors, triad, and monochrome) that provide a set ofpredefined relationship for use in color composition.

Current approaches for color composition, while providing paletteextraction and palette editing features, rely heavily on manual,subjective adjustments by end users. For instance, a graphics editor maydetect that an electronic image includes a color palette with threecolors. But such graphics editor only allow a user to manually adjustspecific color values in the palette, rather than applying anysystematic approach to modifying multiple colors in the palette.Achieving a desirable adjustment to the color palette of an imagetherefore requires extensive trial-and-error on the part of a user, andthe resulting adjustments may still achieve a sub-optimal colorcomposition.

Therefore, existing techniques include disadvantages such as, but notlimited to, those described above.

SUMMARY

Certain embodiments involve applying a palette-based color harmony andpalette-based image recoloration to an electronic image. For instance,an electronic image processing application accesses a color palette thatincludes a first image color at a first position on a color space and asecond image color at a second position on a color space. The electronicimage processing application selects a harmonic template that, whenapplied to the color palette, minimizes an aggregate of hue distances.The electronic image processing application modifies the color paletteby moving at least one of (i) the first image color from the firstposition toward a position along a first axis of the harmonic templateor (ii) the second image color from the second position toward amodified position along a second axis of the harmonic template. Theelectronic image processing application updates an editing interface todisplay the modified color palette.

These illustrative embodiments are mentioned not to limit or define thedisclosure, but to provide examples to aid understanding thereof.Additional embodiments are discussed in the Detailed Description, andfurther description is provided there.

BRIEF DESCRIPTION OF THE DRAWINGS

The patent or application file contains at least one drawing executed incolor. Copies of this patent or patent application publication withcolor drawing(s) will be provided by the Office upon request and paymentof the necessary fee.

Features, embodiments, and advantages of the present disclosure arebetter understood when the following Detailed Description is read withreference to the accompanying drawings.

FIG. 1 depicts an example of a computing environment in which anelectronic image processing application applies palette-based colorcomposition to an electronic image, according to certain embodiments ofthe present disclosure.

FIG. 2 depicts an example of a process for applying palette-based colorcomposition to an electronic image, according to certain embodiments ofthe present disclosure.

FIG. 3 depicts an example of a color palette for an electronic image,according to certain embodiments of the present disclosure.

FIG. 4 depicts an example of applying a harmonic template to the colorpalette of the electronic image, according to certain embodiments of thepresent disclosure.

FIG. 5 depicts an example of modifying colors by applying apalette-based color composition to an electronic image, according tocertain embodiments of the present disclosure.

FIG. 6 depicts an example of a user interface that is updated by theelectronic image processing application, according to certainembodiments of the present disclosure.

FIG. 7 depicts an example of a process for modifying an editinginterface for manipulating an electronic image, according to certainembodiments of the present disclosure.

FIG. 8 depicts an example of a computing system for implementing certainembodiments of the present disclosure.

FIG. 9 depicts examples of image results generated by applyingpalette-based color composition to an input image using certainembodiments of the present disclosure.

FIG. 10 depicts additional examples of image results generated byapplying palette-based color composition to an input image using certainembodiments of the present disclosure.

FIG. 11 depicts examples of image results generated by applyingpalette-based color composition with varying strength factor to an inputimage using certain embodiments of the present disclosure.

DETAILED DESCRIPTION

Certain embodiments involve applying palette-based color composition toan electronic image by performing color composition on a color palettecontaining multiple colors from the electronic image. These embodimentscan perform color composition on a color palette using the relationshipbetween the color palette and a selected color harmony template. Forinstance, the color composition can involve modifying the color paletteto more closely align relationships among the palette colors torelationships between axes of a suitable color harmony template, therebyimproving the aesthetic quality of the electronic image while avoidingthe inconsistent manual manipulation of individual colors.

The following non-limiting example is provided to introduce certainembodiments. In this example, an electronic image processing applicationapplies palette-based color composition to an electronic image. Thepalette-based color composition involves determining a color palettethat includes a first image color at a first position on a color spaceand a second image color at a second position on a color space, such asa cylindrical color space (e.g., HSV, HSL, LCh, etc.). A position of animage color on the color space is defined by coordinates that indicatethe location of the image color on a color space (e.g., an HSV colorwheel, LCh, etc.). A first image color could be the color having thehighest quantity of pixels in the electronic image, or computed visualweight. A second image color could be the color having thesecond-highest quantity of pixels in the electronic image or computedvisual weight. The electronic image processing application optimizes therelationships between the first and second image colors by applying aharmonic template in the color space. A harmonic template is apredefined set of angular relationships (e.g., a relationship such as“triad” with three axes split by 120°). The harmonic template predefinesa relationship between multiple colors that provide a desired aestheticbased on the perception of a human eye.

Continuing with this example, the electronic image processingapplication applies the harmonic template by aligning one or more axeswith the image palette colors, according to a combination of a globalrotation angle and a secondary rotation angle, which minimize anaggregate of hue distances computed from the various image palettecolors at the various locations in the color space. A global rotationangle is the angle applied from a reference point to the location of aprimary axis of the harmonic template that minimizes a summation of theangular distances between the image palette colors and the closest axisof the harmonic template. A secondary rotation angle is the angleapplied to secondary or additional axes of the harmonic template thatfurther reduces the angular distance between the image palette colorsand the axes of the harmonic templates (e.g., some secondary axes canmove up to 30° in both directions, from the initial position set by theglobal rotation angle). The electronic image processing applicationassociates the image palette colors with an axis of the harmonictemplate that is the closest after application of the global rotationangle and secondary rotation angle.

Continuing with this example, the electronic image processingapplication performs palette-based color composition by moving the imagepalette colors from their respective positions towards the closest axesof the harmonic template. For instance, the electronic image processingapplication moves the first image color to a modified first position byapplying a transformation such that the first axis of the harmonictemplate passes through the modified first position. The electronicimage processing application moves the second image color to a modifiedsecond position by applying a transformation such that the second axisof the harmonic template passes through the modified second position.Moving each color involves modifying the color space coordinates so thata distance, in the color space, between the image color and the harmonictemplate axis is decreased (e.g., making an image color more “blue” byincreasing the hue coordinate in a set of HSV coordinates). Theelectronic image processing application updates the color palette withthe modified first and second image colors at their modified secondpositions. The electronic image processing application displays theupdated color palette in an editing interface presented to a user of theelectronic image processing application.

As used herein, the term “electronic image” is used to refer to anelectronic image having color or object information (i.e., a .JPEG, a.PNG, .GIF, a vector image, a raster image). The electronic image can belocal to a device, or a web-based platform, such as a webpage. In someembodiments, a color can be an RGB color converted into an HSV color, ora component color in another cylindrical color space. For instance, acolor can be used to represent visually aesthetic elements of anelectronic image such that the colors of the image can presentcontrasting visual elements.

As used herein, the term “electronic image processing application” isused to refer to a software application being executed on an electronicserver, or group of servers that perform operations on electronicdocuments as described herein.

As used herein, the term “harmonic template” is used to refer to apredefined set of distance relationships between multiple colors thatprovide optimized contrast and aesthetically appealing perceptiveelements.

Referring now to the drawings, FIG. 1 depicts an example of a computingenvironment in which an electronic image processing application appliespalette-based color composition to an electronic image, according tocertain embodiments of the present disclosure. In various embodiments,the computing environment 100 includes an electronic image processingapplication 102. The electronic image processing application 102 is asoftware application for processing electronic image 120.

The electronic image processing application 102 receives an electronicimage 120. One example of the electronic image 120 is a raster image,though other electronic image formats can be used. Electronic imageprocessing application 102 processes the electronic image by applying acolor palette module 110 to electronic image 120. An example of thecolor palette module 110 is a software engine that determines a colorpalette for the electronic image. A color palette is a set of colorscontained in the electronic image 120 that exist in a color space, suchas a HSV (Hue, Saturation, Value) color space.

The color palette module 110 identifies a first image color at a firstposition on the color space. An example of a first image color is a keycolor of electronic image 120, for example, such as a “blue” hue at(205, 95, 70) on the HSV color space. The color palette module 110determines the first image color by identifying the maximum value ofcolor in a color histogram that indicates the number of pixels thatcorrespond to each color in the electronic image 120. A color histogramis a representation of the distribution of colors in the electronicimage 120. The color palette module 110 represents the first color at aposition in a color space. For instance, values at a location (H₁, S₁,V₁) represent a hue angle ranging from [0°, 360° ] measured from the redprimary, a saturation as a real number ranging from [0, 1], and value oflightness (or brightness) as a real number ranging from [0,1] of thefirst color at that location. The color palette module 110 identifies asecond color at a second position on the color space using the secondmaximum of the color histogram. The color palette module 110 representsthe second color at a position in a color space with values (H₂, S₂, V₂)representing the hue angle ranging from [0°, 360° ] measured from thered primary, a saturation as a real number ranging from [0, 1], andvalue of lightness (or brightness) as a real number ranging from [0,1]of the second color. The color palette module 110 represents the colorpalette in a color space with the first color at (H₁, S₁, V₁) and thesecond color at (H₂, S₂, V₂).

The electronic image processing application 102 applies palette harmonymodule 112 to the output of color palette module 110. The paletteharmony module 112 applies a harmonic template to a color space thatincludes the first color at (H₁, S₁, V₁) and the second color at (H₂,S₂, V₂).

The palette harmony module 112 defines a harmonic template by using adefined set of relationships between colors based on a specific colorharmony. The palette harmony module 112 defines the relationship betweencolors as an angle between a first axis that extends through the centerof the color space and the first color, and a second axis that extendsthrough the center of the color space and the second color. An exampleof a color harmony is a relationship between two or more colors thatprovides a visually appealing image, such as two colors in acomplementary harmony with positions directly opposite in the colorspace. In a complementary harmony, if the first color is a “red” at alocation of (0, 1, 1), the corresponding complementary color is a“blue-green” at a location (180, 1, 1). In another example of a colorharmony, a triad color harmony is a relationship between three colors.If a first color of a triad color harmony is a “blue” at location (240,1, 1), then a second color is a “red” at location (0, 1, 1), and thethird color is a “green” at location (120, 1, 1). Further detail ofharmonic templates and color harmonies are described herein with respectto the examples of FIGS. 3 and 4.

The palette harmony module 112 determines a harmonic template byselecting from a set of predefined harmonic templates in harmonictemplate database 113. The harmonic template database 113 contains anynumber of harmonic templates. For example, the harmonic templatedatabase 113 contains monochrome, complementary, single split, triad,double split, square, analogous, T-type, L-type, and N-type harmonictemplates. The palette harmony module 112 determines the harmonictemplate by computing an aggregate hue distance from the selectedharmonic template from harmonic template database 113 to the identifiedcolors of the color palette.

In an example, the palette harmony module 112 receives the output ofcolor palette module 110 and computes an aggregate hue distance fromeach color of the color palette to the closest axis of the harmonictemplate. The palette harmony module 112 may compute the aggregate huedistance after applying a global rotation angle to the harmonictemplate. The palette harmony module 112 defines the global rotationangle as the angle measured from a reference, such as from a location,such as the red primary located at (0, 1, 1) on the HSV color space,that minimizes the distance between the first color of the color paletteand a first axis of the harmonic template.

In other cases, the palette harmony module 112 computes harmonictemplate cost by multiplying the measured hue distance and a visualweight. This computation can be represented asH_(cost)=H_(dist)*W_(visual) with H_(cost) approximating of the hue costof rotating each color into a harmonic position along the closest axisof the harmonic template, H_(dist) represents the Hue distance betweenthe color and the closest axis of the harmonic template, and W_(visual)represents the visual weight of the color within the electronic image120. The palette harmony module 112 computes this by combining thecolor, the lightness value and the saturation value. Accordingly, colorscloser to the center of the color wheel (smaller Saturation values in(H, S, V)) have a lower cost based on the smaller arc distance thancolors that have high values of Saturation that are visualized at theouter edge of the HSV color wheel.

In some embodiments, the palette harmony module 112 applies a secondaryrotation angle to a second axis of a harmonic template. The paletteharmony module 112 defines the secondary rotation angle as an angulardistance (measured in terms of hue angle) between the second axis of theharmonic template and an adjusted position of the second axis. Thepalette harmony module 112 computes the secondary angle such that theadjusted position of the second axis minimizes the distance between thesecond color and the second axis. In some embodiments, the secondaryrotation angle is limited to approximately 30° in order to maintain thedefined relationships of the harmonic template.

The palette harmony module 112 generates modified color palette 114 byapplying transformations to each of the colors included in the colorpalette. In this example, the palette harmony module 112 will apply atransformation to each color of the color palette. The palette harmonymodule 112 modifies the color palette by translating the first colorfrom the first position towards a position along the first axis of theharmonic template. The palette harmony module 112 further modifies thecolor palette by translating the second color from the second positiontowards a position along the second axis of the harmonic template. Thepalette harmony module 112 stores the new positions of each color asmodified color palette 114.

In an alternative embodiment, the palette harmony module 112 generatesthe modified color palette 114 by receiving a user-selection of colorsthat are not extracted from the electronic image 120. The paletteharmony module 112 is agnostic of palette extraction method. In somecases, the palette harmony module 112 uses the color palette 114 andcomputed relevance of each color (e.g., number of pixels, mixingweights, etc.), however, other cases using just the color palette 114and equal relevance values for each color provides similar results.

The electronic image processing application 102 applies the modifiedcolor palette 114 to electronic image 120 to generate modifiedelectronic image 122. The electronic image processing application 102generates modified electronic image by performing a palette-based imagerecoloring process dependent on the palette extraction method, butagnostic with respect to the palette harmonization step. The electronicimage processing application 102 modifies the electronic image 120 byapplying a translation to the colors of the electronic image. Theelectronic image processing application 102 applies a translation thatis representative of the relationship between the modified color palette114 and the output of color palette module 110. The electronic imageprocessing application 102 applies the translation to each color of theelectronic image to generate modified electronic image 122. Theelectronic image processing application 102 outputs the modifiedelectronic image 122. In some embodiments, the electronic imageprocessing application outputs the modified electronic image 122 to apresentation device 140.

FIG. 2 depicts an example of a process 200 for applying palette-basedcolor composition to an electronic image, according to certainembodiments of the present disclosure. One or more computing devices orsoftware applications (e.g., the electronic image processing application102) implement operations depicted by FIG. 2 by executing suitableprogram code. For illustrative purposes, the process 200 is describedwith reference to certain examples depicted in the figure. Otherimplementations, however, are possible.

At block 202, the process 200 involves determining a first image colorat a first position on a color space. The color palette module 110determines the first image color by analyzing the most prolific huewithin the electronic image 120 and computing the coordinates on an HSVcolor wheel. In some embodiments, the color palette module 110 generatesa color histogram of electronic image 120 representing the distributionof colors within the electronic image 120. The color palette module 110determines an overall maximum value of the color histogram anddesignates the overall maximum value as the first color. The colorpalette module 110 assigns the first position of the first color byassigning the HSV coordinates of the color with the maximum relevance orvisual weight.

For example, FIG. 3 depicts an example of a color palette for anelectronic image, according to certain embodiments of the presentdisclosure. In this example, the electronic image 120 is processed bythe color palette module 110. The color palette module 110 extractsmultiple colors 310A-E from electronic image 120. The color palettemodule 110 determines, based on a color histogram maximum or visualweight, that the “first color” is color 310A. The color palette module110 determines that the first position of the first color is at the HSVcoordinates on the color wheel 320. In this example, the color palettemodule 110 determines the first position coordinates (204, 70, 65) offirst color “blue.”

Returning to FIG. 2, at block 204, the process 200 involves determininga second image color at a second position on a color space. Forinstance, the color palette module 110 determines the second image colorby analyzing the second most prolific hue within the electronic image120 and computing the coordinates on a HSV color wheel. In someembodiments, the color palette module 110 determines a second overallmaximum value of the color histogram and designates the second overallmaximum value or visual weight as the second color. The color palettemodule 110 assigns the second position of the second color by assigningthe HSV coordinates of the color with the second overall maximumrelevance or visual weight.

Continuing the previous example from FIG. 3, the color palette moduledetermines that the “second color” is color 310C based on a secondmaximum of the color histogram for electronic image 120. The colorpalette module 110 determines that the second position of the secondcolor is at the HSV coordinates on the color wheel 320. In this example,the color palette module 110 determines the second position coordinates(42, 82, 95) of the second color “yellow.”

At block 206, the process 200 involves applying a harmonic template withat least one axis to the color space. The palette harmony module 112selects a harmonic template from harmonic template database 113. Thepalette harmony module 112 determines the harmonic template to select bycomparing each harmonic template in harmonic template database 113 tothe relationship between the first color and the second color. Thepalette harmony module 112 computes for each harmonic template anaggregate hue distance, measured from the closest axis of the harmonictemplate to the respective first or second color.

Continuing the previous example from FIG. 3, the palette harmony module112 applies various harmonic templates of harmonic template database113. In this example, the angular distance between first color 310A andsecond color 310C is compared to various harmonic templates of harmonictemplate database 113. In some embodiments, the palette harmony module112 applies a global rotation angle to multiple axes of the harmonictemplate. Applying the global rotation angle causes the first axis ofthe harmonic template to pass through the center of the HSV color spaceand the first color at the first position. The palette harmony module112 measures the global rotation angle from a reference position, whichin some cases is the primary color “red” at (0, 1, 1). The paletteharmony module 112 determines a closest color harmonic template bycomputing the aggregate hue distance between each color and the closestaxis. In this example, the palette harmony module 112 determines thatthe harmonic template for the first color at the first position and thesecond color at the second position is a triad harmonic template.Further details regarding the computation of the harmonic template arediscussed in relation to FIG. 4.

In additional or alternative embodiments involving the example of FIG.3, the angular distances between first color 310A, second color 310C,third color 310B, fourth color 310D, and fifth color 310E are comparedto various harmonic templates of harmonic template database 113. Thepalette harmony module 112 applies a global rotation angle to multipleaxes of the harmonic template such that the first axis of the harmonictemplate passes through the center of the HSV color space and minimizesthe aggregate hue distance from each of the colors 310A-E to the closestaxis of the harmonic template as applied. For example, as illustrated inFIG. 3, the palette harmony module 112 computes the distance between thefirst color 310A and third color 310B. The palette harmony module 112determines that the first axis of harmonic template will minimizeaggregate hue distance when placed between the first color 310A and thethird color 310B.

In some cases, the palette harmony module 112 associates the each of thecolors 310A-E to the axis of the harmonic template that is closest tothe respective color. In one example, the palette harmony module 112associates each of color 310A-C with the first axis of the harmonictemplate, and each of color 310D-E with the second axis of the harmonictemplate. The palette harmony module 112 associates each of the colorsand including indications of the side of the respective axes that eachof color 310A-E are positioned to enforce maintenance of a contrastrelationship (i.e., warm color “red”, cool color “blue”).

In another example (i.e., monochrome palette with a triad style colorpalette), the palette harmony module 112 associates each of color 310A-Ewith the first axis of the harmonic template, and based on thedistribution of colors in the color space, does not associate any ofcolors 310A-E with the second axis of the harmonic template. In theabove example of a triad template, if the palette harmony module 112identifies an axis of a harmonic template that does not have anassociated image color, the palette harmony module 112 determines theharmonic unsuitable for the image and selects a different harmonictemplate from harmonic template database 113.

Returning to FIG. 2, at block 208, the process 200 involves modifyingthe color palette by moving the first position or the second positiontowards an axis of the harmonic template to a modified first position ormodified second position. The color palette module 110 extracts multiplecolors 310A-E of electronic image 120. The colors 310A-E that representthe most prolific hues in electronic image 120 can be represented on apalette, such as color palette 304. The color palette module 110 canrepresent any number of colors 310A-E, and as illustrated in FIG. 3,represents five colors of electronic image 120. The color palette canalso be represented on a color wheel as shown by colors 310A-Edistributed on color wheel 320. As described above with regard to FIG.3, palette harmony module 112 applies a harmonic template with more thanone axis to the color palette. The palette harmony module 112 modifiesthe color palette 304 by moving at least one color of the color palette304 towards the closest axis of the harmonic template. In an example,the palette harmony module 112 modifies the first color at the firstposition to a modified position along the first axis of the harmonictemplate. The palette harmony module 112 stores the modified firstposition, the modified second position, etc.

In another example, the palette harmony module 112 stores the huedistance relationship between a color 310 of the color palette 304 andan axis (e.g., first axis, second axis, third axis, etc.) of theharmonic template. The palette harmony module 112 modifies the positionof the colors 310A-E based on input received from a user input devicethat indicates a desired modification of the axis of the harmonictemplate (e.g., the first axis, the second axis, the third axis, etc.)or a desired modification of a position of a color 310. Further detailsof the computations relating to harmonic templates are described withregard to FIG. 4

At block 210, the process 200 involves updating the editing interface todisplay the modified color palette or an electronic image that has thefirst image color or the second image color at the modified firstposition or modified second position. The electronic image processingapplication 102 updates an editing interface, such as the editinginterface depicted by FIG. 6 to display a modified color palette 114 ora modified electronic image 122 that has been transformed by thedifference between the color palette 304 and the modified color palette114. For example, the electronic image processing application 102translates the colors 310A-E of electronic image 120 to modifiedpositions that are translated by the corresponding difference of themodified color palette 114 and color palette 304. A visual example andfurther explanation are provided with regard to FIG. 6.

FIG. 4 illustrates an example of applying a harmonic template to thecolor palette of the electronic image, according to certain embodimentsof the present disclosure. In this example, the palette harmony module112 receives the color palette 304 from the color palette module 110.The color palette 304 identifies the first color 310A and the secondcolor 310C. The palette harmony module 112 applies various harmonictemplates from harmonic template database 113 to the electronic image120. The palette harmony module 112 computes the distance between eachof the colors 310A-E and the closest axis of each harmonic template. Thepalette harmony module 112 computes, from the combination of thesedistances, an aggregate hue distance from the harmonic template to thecolors 310A-E. The palette harmony module 112 selects the harmonictemplate from the harmonic template database 113 that minimizes theaggregate hue distance from the harmonic template to the colors 310A-E.

In one example, the palette harmony module 112 selects a triad harmonictemplate 402. The palette harmony module 112 computes the distance D₁between the first color 310A and the closest point of the first axis403A of the triad harmonic template 402 using a formula such as:D ₁ =|H _(Axis) −H _(Color)|  (1).

In Equation (1), H_(Axis) represents the angular hue position of theaxis of the harmonic template as measured from the reference, andH_(Color) represents the angular hue position of the axis of the firstcolor 310A as measured from the reference, where the reference is theprimary red color at position (0, 1, 1). Accordingly, D₂ is computedbetween color 310B and axis 403A, D₃ is computed between second color310C and axis 403B, D₄ is computed between color 310D and axis 403B, andD₅ is computed between color 310E and axis 403C. The palette harmonymodule 112 computes the aggregate hue distance D_(Agg) by performing asummation of the n distances between the various colors 310A-E and therespective closest axes of the harmonic template 403. An example of aformula for this aggregate distance computation is D_(Agg)=D₁+D₂+ . . .+D_(n). The saturation and value parameters of the colors 310A-E do notimpact hue distance and are thus not included in this computation.

In another example, the palette harmony module 112 selects acomplementary harmonic template 404. The palette harmony module 112computes the aggregate hue distance for the harmonic template 404 usingEquation (1) and the values of H_(Axis) for the single axis 405A of thecomplementary harmonic template 404. For instance, D₁ is computedbetween color 310A and axis 405A, D₂ is computed between color 310B andaxis 405A, D₃ is computed between second color 310C and axis 405A, D₄ iscomputed between color 310D and axis 405A, and D₅ is computed betweencolor 310E and axis 405A.

In some embodiments, the palette harmony module 112 computes a secondaryrotation angle between the second axis (e.g., or additional axes) of theharmonic template and an adjusted position of the second axis. Thesecondary rotation angle further reduces the aggregate hue distancebetween a harmonic template and colors 310A-E. In one example, thepalette harmony module 112 limits the secondary rotation angle toapproximately 30 degrees, which can maintain the defined relationshipsof the harmonic template.

The palette harmony module 112 can generate a modified color palette 114by performing a color harmonization on the color palette 304 using theapplied harmonic template. The palette harmony module 112 performs colorharmonization by modifying the color palette 304 to more closely alignwith the applied harmonic template.

For example, the palette harmony module 112 modifies the first color310A from the first position (H₁, S₁, V₁) towards the first axis 403A toa modified first position (H′₁, S′₁, V′₁) along the axis 403A. Thepalette harmony module moves the first position to a modified firstposition, where the axis 403A passes through the modified firstposition. In some embodiments, the palette harmony module 112 moves thefirst color along an arc such that the modified first position is thesame distance from the origin of the HSV color wheel S₁ as the firstposition (H₁, S₁, V₁). The palette harmony module 112 can also move thesecond color 310C from the second position (H₂, S₂, V₂) towards thesecond axis 403B to a modified second position (H′₂, S′₂, V′₂) along theaxis 403B The palette harmony module moves the second position to amodified second position where the axis 403B passes through the modifiedsecond position. The palette harmony module 112 may modify anycombination of the colors 310A-E to modified positions. In someinstances, the palette harmony module 112 may modify a particular colorof colors 310A-E at a position based on input received from a user.

FIG. 5 illustrates an example of modifying colors by applying apalette-based color composition to an electronic image, according tocertain embodiments of the present disclosure. In this example, theelectronic image processing application 102 applies transformations tothe electronic image 120 to generate the modified electronic image 122.

For example, the color palette module 110 determines, from electronicimage 120, a color palette 304 with colors 502A, 502B, 502C, 502D, and502E. The palette harmony module 112 applies a harmonic template to thecolor palette 304. The palette harmony module 112 modifies, using theapplied harmonic template, the positions of various colors to generatemodified color palette 114 with colors 506A, 506B, 506C, 506D, and 506E.The palette harmony module 112 provides the modified color palette 114to the electronic image processing application 102.

In some embodiments, the color palette module 110 extracts the colorpalette 304 with colors 502A-E from electronic image 120. The electronicimage processing application 102 can apply the transformationsrepresented by a function of the color palette 304 and the modifiedcolor palette 114. For example, the electronic image processingapplication transforms pixels of electronic image 120 based on eachpixel's color distance to a corresponding color of the color palette.The electronic image processing application may apply transforms to anindividual pixel of the electronic image 120 that are proportional tothe distance between the first color and second color. In other words, apixel that is halfway between the first color at the first position andthe second color at the second position has a modification thatrepresents 50% of the modification to the first position, and 50% of themodification to the second position. For example, the palette harmonymodule 112 moves the first color from a first position (H₁, S₁, V₁) withvalues (90, 1, 0.50) to the modified first position (H′₁,S′₁, V′₁) withvalues (120, 1, 0.5). The palette harmony module 112 would move thepixels that are halfway between the first color and second color by(+30, 0, 0) to represent half of the movement (+30° of hue) between thefirst position and the modified first position (e.g., half of the totaltranslation of (+30, 0, 0). The palette harmony module 112 would apply asimilar computation to pixel based on the second color movement. Theelectronic image processing application 102 adjusts each pixel ofelectronic image 120 to generate a modified electronic image 122. Theelectronic image processing application 102 outputs the modifiedelectronic image 122, in some cases to a presentation device 140 thatpresents the modified electronic image 122 as part of a user interface,such as the interface depicted in FIG. 6.

In alternative or additional embodiments, the color palette module 110can determine the color palette 304 by other means such as receiving aset of selected colors from a user interaction, or an arbitrary set ofcolors generated by the electronic image processing application 102 canapply the transformations represented by a function of the color palette304 and the modified color palette 114.

Although the examples above involve an HSV color space, otherimplementations are possible. In an example using LCh color space, thepalette harmony module 112 computes the global rotation angle as ameasure of angular distance (e.g., at a constant distance from theorigin of the color space) between the color palette 304 and theharmonic template. The palette harmony module 112 computes the cost ofthe harmonization calculating D(P,T_(m)(∝))=Σ_(i=1)^(|P|)W(P_(i))·L(P_(i))·C(P_(i))·|H(P_(i))−T_(m) ^(j*)(∝)|, where P_(i)represents a color 310 of the color palette 304. And

$j^{*} = {\underset{j = {1\mspace{14mu}\ldots\mspace{14mu} n}}{\arg\min}{{{H\left( P_{i} \right)} - {T_{m}^{i}(\alpha)}}}}$is the axis closest to each color. The palette harmony module 112represents j* as the axis of the harmonic template that is closest toeach of the colors 310A-E, H(P₁) represents the position of the colorP_(i) from the colors 310A-E, and T_(m) ^(j)(α) represents j axis of thetemplate T_(m) (i.e., m indicates the selected template from harmonictemplate database 113) closest to the palette color at the globalrotation angle α. The palette harmony module 112 uses the W(P_(i)) termto represent the contribution of the color P_(i) to all of the pixels inelectronic image 120. The palette harmony module 112 uses W(P_(i)) tomore accurately align the first axis with the first color 310A. Thepalette harmony module 112 uses the L(P_(i)) and the C(P_(i)) terms torepresent the lightness and chroma, respectively, of the electronicimage 120. The palette harmony module uses chroma to compute thecircular sector between a color 310 and the harmonic template 403. Asmaller value of L(P_(i)) and C(P_(i)) (e.g., a darker and lesssaturated electronic image 120) results in a smaller arc as the positionof the color 310 is positioned near the center of the LCh color space.The palette harmony module 112 computes the D for each harmonic templateT_(m) and global rotation angle ∝ value (e.g., the global rotation angleis bounded by values [0, 360]) to determine a combination of harmonictemplate and global rotation angle that generate the smallest value ofD_(Lch). The palette harmony module 112 performs a minimization functionto search for the global rotation angle. For example, the paletteharmony module 112 searches for the global rotation angle using acomputation that is represented by a formula, such as:

$\begin{matrix}{\alpha_{m}^{*} = {\underset{\alpha}{\arg\min}{{D\left( {P,{T_{m}(\alpha)}} \right)}.}}} & (2)\end{matrix}$

In Equation (2), α_(m)* represents the global rotation angle thatminimizes the hue distance D of the template T_(m) from the colorpalette P.

Similarly, the palette harmony module 112 determines the harmonictemplate that minimizes the aggregate hue distance. For example, thepalette harmony module 112 performs a computation that is represented by

$T_{m}^{*} = {\underset{T_{m}}{\arg\min}\;{{D\left( {P,{T_{m}\left( \alpha_{m}^{*} \right)}} \right)}.}}$The palette harmony module 112 uses T_(m)* to represent the templatethat minimizes the aggregate hue distance and D(P,T_(m)(α_(m)*)) is afunction of the distance between the color palette P and the templateT_(m)(α_(m)*) at the global rotation angle that minimizes the huedistance of the template T_(m). FIG. 6 depicts an example of userinterface 602 that is updated by the electronic image processingapplication 102, according to certain embodiments of the presentdisclosure. The electronic image processing application 102 generates auser interface 602 having multiple elements including electronic image120, modified electronic image 122, color palette 304, modified colorpalette 114, user selectable edits 612A and 612B, and harmonized colorwheels 606A and 606B.

For example, the electronic image processing application 102 displaysthe electronic image 120 in the user interface 602. The color palettemodule 110 generates a color palette 304 using processes described inrelation to FIGS. 2 and 3. The electronic image processing application102 displays the color palette 304 in the user interface 602. Thepalette harmony module 112 determines a harmonic template from theharmonic template database 113. In this case, the monochrome harmonictemplate is selected and applied and displayed on the color wheel 606Aalong with the color palette 304. The palette harmony module 112 adjustspositions of the colors of the color palette 304 in response toreceiving inputs from the user selectable edits 612A.

In some embodiments, the user selectable edits 612A include the controls“rotate”, “optimal”, “scale”, and “template.” The user selectable edits612A correspond to particular manipulations of the color palette 304 andthe harmonic template applied. For instance, the “rotate” control addsan extra global rotation to the template after it has been applied tothe original positions of the image colors. In response to the userselecting a rotate value between [0, 359], the palette harmony module112 adjusts all axes of the harmonic template, and all of the colors ofthe color palette 304 to new positions rotated a corresponding number ofdegrees [0, 359] around the color wheel. The “optimal” control isselectable for values “0” or “1”. In response to a user selection of thevalue “1” for the optimal control, the palette harmony module 112automatically finds a fitting harmonic template with the minimalaggregate hue distance and selects the fitting harmonic template forapplication to the color palette 304. In response to a user adjustingthe “scale” control, the palette harmony module 112 to move each colorof the color palette 304 towards the axis of the template. A value of“0” for the scale control results in no adjustment of the colors, and incontrast a value of 0.94 shown in user selectable edits 612A results inthe palette harmony module 112 moving the colors towards the axis of theharmonic template an amount equal to 94% of the distance between thecolor and the axis of the harmonic template. Modifying the “template”control enables the user to select the desired template to be applied bymodule 112. In response to adjustments to the user selectable edits612A, the electronic image processing application updates the userinterface 602 to display the modified color palette 114 and the modifiedelectronic image 122 that corresponds to the transformation applied tothe modified color palette 114.

In another example involving a different set of values for userselectable edits 612B, the electronic image processing application 102generates an updated user interface 620. The updated user interface 620includes the electronic image 120, the color palette 304, the modifiedharmonized color wheel 606B, the modified color palette 114, and themodified electronic image 122. In response to the different values ofuser selectable edits 612B, the palette harmony module 112 modifies thecolor palette 304. The user selectable edits 612B include a value“rotate” of 226.63, an “optimal” value of “0”, a value of “scale” of“1.0”, and a “template” value of “1.” The palette harmony module 112modifies the axis of the harmonic template as shown in color wheel 606B.Accordingly, the palette harmony module 112 adjusts each color of colorpalette 304 to generate modified color palette 114. In response to theoptimal value, the palette harmony module 112 makes no modifications tothe color palette 304. In response to the scale value, the paletteharmony module 112 adjusts the colors of color palette 304 to a positionalong the axis of the monochrome harmonic template. In response to thetemplate value, the palette harmony module selects the monochromeharmonic template, corresponding to the value “1.”

FIG. 7 depicts an example of a process 700 for modifying an editinginterface for manipulating an electronic image, according to certainembodiments of the present disclosure. One or more computing devices orsoftware applications (e.g., the electronic image processing application102) implement operations depicted by FIG. 7 by executing suitableprogram code. For illustrative purposes, the process 700 is describedwith reference to certain examples depicted in the figure. Otherimplementations, however, are possible.

At block 702, the process 700 involves determining a color palette forthe electronic image. For instance, the electronic image processingapplication 102 can implement block 702 by performing one or moreoperations described above with respect to the color palette module 110of FIG. 1.

At block 704, the process 700 involves displaying, on the editinginterface, a first color-adjustment element positioned on an axisgraphical element and a second color-adjustment element. For instance,the electronic image processing application 102 can implement block 704by performing one or more operations described above with respect to thepalette harmony module 112 of FIG. 1 and with respect to FIG. 6.

At block 706, the process 700 involves receiving via the editinginterface, edits to the positions of the first color-adjustment elementand the second color-adjustment element. For instance, the electronicimage processing application 102 can implement block 706 by performingone or more operations described above with respect to the input device130 and user selectable edits 612A and 612B with regard to FIG. 1 andFIG. 6 respectively.

At block 708, the process 700 involves modifying the first position andthe second position in response to the edits to the positions of thefirst color-adjustment element and the second color-adjustment element.For instance, the electronic image processing application 102 canimplement block 708 by performing one or more operations described abovewith respect to the palette harmony module 112 of FIG. 1 and with regardto FIG. 6.

At block 710, the process 700 involves updating the editing interface todisplay the modified color palette based on the modified first positionand the modified second position. For instance, the electronic imageprocessing application 102 can implement block 710 by performing one ormore operations described above with respect to the presentation device140 of FIG. 1 and the updated user interface 620 of FIG. 6.

At block 712, the process 700 involves updating a preview section of theediting interface to display a preview of modifications to theelectronic image. For instance, the electronic image processingapplication 102 can implement block 712 by performing one or moreoperations described above with respect to the palette harmony module112 and the presentation device 140 of FIG. 1, and the updated userinterface 620 of FIG. 6

Example of a Computing System for Implementing Certain Embodiments

Any suitable computing system or group of computing systems can be usedfor performing the operations described herein. For example, FIG. 8depicts an example of the computing system 800. The implementation ofcomputing system 800 could be used for one or more of an electronicimage processing application 102 and a palette harmony module 112. Inother embodiments, a single computing system 800 having devices similarto those depicted in FIG. 8 (e.g., a processor, a memory, etc.) combinesthe one or more operations and data stores depicted as separate systemsin FIG. 1.

The depicted example of a computing system 800 includes a processor 802communicatively coupled to one or more memory devices 804. The processor802 executes computer-executable program code stored in a memory device804, accesses information stored in the memory device 804, or both.Examples of the processor 802 include a microprocessor, anapplication-specific integrated circuit (“ASIC”), a field-programmablegate array (“FPGA”), or any other suitable processing device. Theprocessor 802 can include any number of processing devices, including asingle processing device.

A memory device 804 includes any suitable non-transitorycomputer-readable medium for storing electronic image processingapplication 102, harmonic template database 113, or both. Acomputer-readable medium can include any electronic, optical, magnetic,or other storage device capable of providing a processor withcomputer-readable instructions or other program code. Non-limitingexamples of a computer-readable medium include a magnetic disk, a memorychip, a ROM, a RAM, an ASIC, optical storage, magnetic tape or othermagnetic storage, or any other medium from which a processing device canread instructions. The instructions may include processor-specificinstructions generated by a compiler or an interpreter from code writtenin any suitable computer-programming language, including, for example,C, C++, C#, Visual Basic, Java, Python, Perl, JavaScript, andActionScript.

The computing system 800 may also include a number of external orinternal devices, an input device 130, a presentation device 140, orother input or output devices. For example, the computing environment100 is shown with one or more input/output (“I/O”) interfaces 808. AnI/O interface 808 can receive input from input devices or provide outputto output devices. One or more buses 806 are also included in thecomputing system 800. The bus 806 communicatively couples one or morecomponents of a respective one of the computing system 800.

The computing system 800 executes electronic image processingapplication 102 that configures the processor 802 to perform one or moreof the operations described herein. Examples of the electronic imageprocessing application 102 include, in various embodiments, colorpalette module 110, palette harmony module 112, or other suitableapplications that perform one or more operations described herein (e.g.,one or more development applications for generation of the modifiedelectronic image 122 or the harmonic template database 113). The programcode may be resident in the memory device 804 or any suitablecomputer-readable medium and may be executed by the processor 802 or anyother suitable processor.

In some embodiments, one or more memory devices 804 stores program datasuch as parameters and settings for the harmonic template database 113,modified color palette 114, or both. In additional or alternativeembodiments, one or more of the programs, images, modules, and functionsdescribed herein are stored in different memory devices 804 accessiblevia a data network.

In some embodiments, the computing system 800 also includes a networkinterface device 810. The network interface device 810 includes anydevice or group of devices suitable for establishing a wired or wirelessdata connection to one or more data networks. Non-limiting examples ofthe network interface device 810 include an Ethernet network adapter, amodem, and/or the like. The computing system 800 is able to communicatewith one or more other computing devices (e.g., a computing deviceexecuting an electronic image processing application 102) via a datanetwork using the network interface device 810.

In some embodiments, the computing system 800 also includes the inputdevice 130 and the presentation device 140 depicted in FIG. 8. An inputdevice 130 can include any device or group of devices suitable forreceiving visual, auditory, or other suitable input that controls oraffects the operations of the processor 802. Non-limiting examples ofthe input device 130 include a touchscreen, a mouse, a keyboard, amicrophone, a separate mobile computing device, etc. A presentationdevice 140 can include any device or group of devices suitable forproviding visual, auditory, or other suitable sensory output.Non-limiting examples of the presentation device 140 include atouchscreen, a monitor, a speaker, a separate mobile computing device,etc.

Although FIG. 8 depicts the input device 130 and the presentation device140 as being local to the computing device that executes the electronicimage processing application 102, other implementations are possible.For instance, in some embodiments, one or more of the input device 130and the presentation device 140 can include a remote client-computingdevice that communicates with the computing system 800 via the networkinterface device 810 using one or more data networks described herein.

Examples of Image Results Generated with Palette-Based Color Composition

FIG. 9 depicts examples of image results generated by applyingpalette-based color composition to an input image 902 using certainembodiments of the present disclosure. In FIG. 9, the input image 902has a color palette 903 that can be represented on color wheel 904904.Applying palette-based color composition to the input image 902generates a corresponding modified image 906 having a modified colorpalette 905 by using an applied monochrome harmonic template 908. Inanother example, applying palette-based color composition to the inputimage 902 generates a corresponding modified image 910 having a modifiedcolor palette 907 by using an applied complementary harmonic template912. In yet another example, applying palette-based color composition tothe input image 902 generates a corresponding modified image 914 havinga modified color palette 909 by using an applied triad harmonic template916.

FIG. 10 depicts additional examples of image results generated byapplying palette-based color composition to an input image using certainembodiments of the present disclosure. In one example, an input image1004 has a color wheel 1002 that represents a color palette 1006. Thepalette harmony module 112 can generate a harmonized image 1008 having amodified color palette 1010 by using an applied triad harmonic template1012. In another example, an input image 1016 has a color wheel 1016that represents a color palette 1018. The palette harmony module 112 cangenerate a harmonized image 1020 having a modified color palette 1022 byusing an applied triad harmonic template 1024. In these examples, thepalette harmony module 112 determined the optimal harmonic template forthe color palettes and applied the harmonic template automatically.

FIG. 11 depicts examples of image results generated by applyingpalette-based color composition with varying strength factor (“scale”)to an input image using certain embodiments of the present disclosure.In this example, an input image 1102 having a strength factor of β=0 istransformed into various harmonized images 1104, 1108, 1112, and 1116using respective applied harmonic templates 1106, 1110, 1114, 1118. Theapplied harmonic templates 1106, 1110, 1114, 1118 correspond,respectively, to values of β=0.5, β=0.7, β=1.0, and β=1.5.

General Considerations

Numerous specific details are set forth herein to provide a thoroughunderstanding of the claimed subject matter. However, those skilled inthe art will understand that the claimed subject matter may be practicedwithout these specific details. In other instances, methods,apparatuses, or systems that would be known by one of ordinary skillhave not been described in detail so as not to obscure claimed subjectmatter.

Unless specifically stated otherwise, it is appreciated that throughoutthis specification discussions utilizing terms such as “processing,”“computing,” “calculating,” “determining,” and “identifying” or the likerefer to actions or processes of a computing device, such as one or morecomputers or a similar electronic computing device or devices, thatmanipulate or transform data represented as physical electronic ormagnetic quantities within memories, registers, or other informationstorage devices, transmission devices, or display devices of thecomputing platform.

The system or systems discussed herein are not limited to any particularhardware architecture or configuration. A computing device can includeany suitable arrangement of components that provide a result conditionedon one or more inputs. Suitable computing devices include multi-purposemicroprocessor-based computer systems accessing stored software thatprograms or configures the computing system from a general purposecomputing apparatus to a specialized computing apparatus implementingone or more embodiments of the present subject matter. Any suitableprogramming, scripting, or other type of language or combinations oflanguages may be used to implement the teachings contained herein insoftware to be used in programming or configuring a computing device.

Embodiments of the methods disclosed herein may be performed in theoperation of such computing devices. The order of the blocks presentedin the examples above can be varied—for example, blocks can bere-ordered, combined, and/or broken into sub-blocks. Certain blocks orprocesses can be performed in parallel.

The use of “adapted to” or “configured to” herein is meant as open andinclusive language that does not foreclose devices adapted to orconfigured to perform additional tasks or steps. Additionally, the useof “based on” is meant to be open and inclusive, in that a process,step, calculation, or other action “based on” one or more recitedconditions or values may, in practice, be based on additional conditionsor values beyond those recited. Headings, lists, and numbering includedherein are for ease of explanation only and are not meant to belimiting.

While the present subject matter has been described in detail withrespect to specific embodiments thereof, it will be appreciated thatthose skilled in the art, upon attaining an understanding of theforegoing, may readily produce alternatives to, variations of, andequivalents to such embodiments. Accordingly, it should be understoodthat the present disclosure has been presented for purposes of examplerather than limitation, and does not preclude the inclusion of suchmodifications, variations, and/or additions to the present subjectmatter as would be readily apparent to one of ordinary skill in the art.

The invention claimed is:
 1. A method that includes one or moreprocessing devices performing operations comprising: accessing a colorpalette comprising a first image color at a first position in a colorspace and a second image color at a second position in the color space;selecting a harmonic template that minimizes an aggregate of huedistances that comprise a first hue distance and a second hue distance,wherein the first hue distance is computed from a first axis of theharmonic template and the first image color at the first position,wherein the second hue distance is computed from a second axis of theharmonic template and the second image color at the second position;modifying, based on the selected harmonic template, the color palette bymoving at least one of (i) the first image color from the first positiontoward a first modified position along the first axis or (ii) the secondimage color from the second position toward a second modified positionalong the second axis; and updating an editing interface to display themodified color palette.
 2. The method of claim 1, the operations furthercomprising computing the aggregate of hue distances by, at least:rotating the harmonic template by a global rotation angle such that thefirst hue distance is minimized; and computing each of the hue distancesbased on the harmonic template as rotated by the global rotation angle.3. The method of claim 2, the operations further comprising applying asecondary rotation angle to the second axis of the harmonic template,wherein one or more of the hue distances is computed further based onthe second axis with the secondary rotation angle applied.
 4. The methodof claim 3, wherein the secondary rotation angle is constrained to athreshold angle.
 5. The method of claim 1, the operations furthercomprising: displaying, on the editing interface, a firstcolor-adjustment element positioned on an axis graphical element and asecond color-adjustment element, wherein: (i) the first color-adjustmentelement represents the first image color, (ii) the secondcolor-adjustment element represents the second image color, (iii) theaxis graphical element represents one or more of the first axis and thesecond axis, and (iv) positions of the first color-adjustment elementand the second color-adjustment element, respectively, represent thefirst image color at the first position in the color space and thesecond image color at the second position in the color space; receiving,via the editing interface, edits to the positions of the firstcolor-adjustment element and the second color-adjustment element;modifying the first position and the second position in response to theedits to the positions of the first color-adjustment element and thesecond color-adjustment element; updating the editing interface todisplay the modified color palette based on the modified first positionand the modified second position; and updating a preview section of theediting interface to display a preview of modifications to an electronicimage associated with the modified color palette, wherein updating thepreview section comprises adjusting, in the electronic image asdisplayed in the preview section, a first hue in accordance with themodified first position and a second hue in accordance with the modifiedsecond position.
 6. The method of claim 5, wherein one or more of theedits to the positions of the first color-adjustment element and thesecond color-adjustment element is selected from a group of editinginputs including a global rotation angle, a harmonic template strengthfactor, a manual harmonic template selection, or an automatic selectionof a fitting harmonic template.
 7. The method of claim 5, whereinupdating the preview section of the editing interface to display thepreview of modifications to the electronic image includes displayingtransformations applied to the color palette in the updated previewsection, wherein the transformations applied to the color paletteinclude: the first image color at the first position; the second imagecolor at the second position; the first image color at the modifiedfirst position; the second image color at the modified second position;and the harmonic template.
 8. A computing system comprising: anon-transitory computer-readable medium storing program code; andprocessing hardware communicatively coupled to the non-transitorycomputer-readable medium and configured to execute the program code andthereby perform operations comprising: accessing a color palettecomprising a first image color at a first position in a color space anda second image color at a second position in the color space, selectinga harmonic template that minimizes an aggregate of hue distances thatcomprise a first hue distance and a second hue distance, wherein thefirst hue distance is computed from a first axis of the harmonictemplate and the first image color at the first position, wherein thesecond hue distance is computed from a second axis of the harmonictemplate and the second image color at the second position, andmodifying, based on the selected harmonic template, the color palette bymoving at least one of (i) the first image color from the first positiontoward a first modified position along the first axis or (ii) the secondimage color from the second position toward a second modified positionalong the second axis.
 9. The computing system of claim 8, theoperations further comprising computing the aggregate of hue distancesby, at least: rotating the harmonic template by a global rotation anglesuch that the first hue distance is minimized; and computing each of thehue distances based on the harmonic template as rotated by the globalrotation angle.
 10. The computing system of claim 9, the operationsfurther comprising applying a secondary rotation angle to the secondaxis of the harmonic template, wherein one or more of the hue distancesis computed further based on the second axis with the secondary rotationangle applied.
 11. The computing system of claim 10, wherein thesecondary rotation angle is constrained to a threshold angle.
 12. Thecomputing system of claim 8, the operations further comprising:displaying, on an editing interface, a first color-adjustment elementpositioned on an axis graphical element and a second color-adjustmentelement, wherein: (i) the first color-adjustment element represents thefirst image color, (ii) the second color-adjustment element representsthe second image color, (iii) the axis graphical element represents oneor more of the first axis and the second axis, and (iv) positions of thefirst color-adjustment element and the second color-adjustment element,respectively, represent the first image color at the first position inthe color space and the second image color at the second position in thecolor space; receiving, via the editing interface, edits to thepositions of the first color-adjustment element and the secondcolor-adjustment element; modifying the first position and the secondposition in response to the edits to the positions of the firstcolor-adjustment element and the second color-adjustment element;updating the editing interface to display the modified color palettebased on the modified first position and the modified second position;and updating a preview section of the editing interface to display apreview of modifications to an electronic image associated with themodified color palette, wherein updating the preview section comprisesadjusting, in the electronic image as displayed in the preview section,a first hue in accordance with the modified first position and a secondhue in accordance with the modified second position.
 13. The computingsystem of claim 12, wherein one or more of the edits to the positions ofthe first color-adjustment element and the second color-adjustmentelement is selected from a group of editing inputs including a globalrotation angle, a harmonic template strength factor, a manual harmonictemplate selection, or an automatic selection of a fitting harmonictemplate.
 14. The computing system of claim 12, wherein updating thepreview section of the editing interface to display the preview ofmodifications to the electronic image includes displayingtransformations applied to the color palette in the updated previewsection, wherein the transformations applied to the color paletteinclude: the first image color at the first position; the second imagecolor at the second position; the first image color at the modifiedfirst position; the second image color at the modified second position;and the harmonic template.
 15. A non-transitory computer-readable mediumon which program code executable by processing hardware is stored,wherein the program code, when executed by the processing hardware,performs operations comprising: accessing an electronic image; a stepfor applying palette-based color composition to the electronic image,comprising: accessing a color palette of the electronic image, the colorpalette comprising a first image color at a first position in a colorspace and a second image color at a second position in the color space;and selecting a harmonic template that minimizes an aggregate of huedistances that comprise a first hue distance and a second hue distance,wherein the first hue distance is computed from a first axis of theharmonic template and the first image color at the first position,wherein the second hue distance is computed from a second axis of theharmonic template and the second image color at the second position;modifying, based on the selected harmonic template, the color palette bymoving at least one of (i) the first image color from the first positiontoward a first modified position along the first axis or (ii) the secondimage color from the second position toward a second modified positionalong the second axis; and updating an editing interface to display theelectronic image having the applied palette-based color composition. 16.The non-transitory computer-readable medium of claim 15, wherein thestep for applying the palette-based color composition further comprises:updating the editing interface to display the modified color palette.17. The non-transitory computer-readable medium of claim 16, theoperations further comprising computing the aggregate of hue distancesby, at least: rotating the harmonic template by a global rotation anglesuch that the first hue distance is minimized; and computing each of thehue distances based on the harmonic template as rotated by the globalrotation angle.
 18. The non-transitory computer-readable medium of claim17, the operations further comprising applying a secondary rotationangle to the second axis of the harmonic template, wherein one or moreof the hue distances is computed further based on the second axis withthe secondary rotation angle applied.
 19. The non-transitorycomputer-readable medium of claim 18, wherein the secondary rotationangle is constrained to a threshold angle.
 20. The non-transitorycomputer-readable medium of claim 15, the operations further comprising:displaying, on the editing interface, a first color-adjustment elementpositioned on an axis graphical element and a second color-adjustmentelement, wherein: (i) the first color-adjustment element represents afirst image color of a color palette from the electronic image, (ii) thesecond color-adjustment element represents a second image color from theelectronic image, (iii) the axis graphical element represents one ormore of a first axis of a harmonic template applied to the color paletteand a second axis of the harmonic template, and (iv) positions of thefirst color-adjustment element and the second color-adjustment element,respectively, represent the first image color at a first position in acolor space and the second image color at a second position in the colorspace; receiving, via the editing interface, edits to the positions ofthe first color-adjustment element and the second color-adjustmentelement; generating a modified color palette by, at least, modifying thefirst position and the second position in response to the edits to thepositions of the first color-adjustment element and the secondcolor-adjustment element; updating the editing interface to display themodified color palette; and updating a preview section of the editinginterface to display a preview of modifications to the electronic image,wherein updating the preview section comprises adjusting, in theelectronic image as displayed in the preview section, a first hue inaccordance with the modified first position and a second hue inaccordance with the modified second position.